const express = require('express')
const app = express()
app.engine('.html', require('ejs').__express)
app.set('view engine', 'html')
app.set('views', './views')
app.get('/', (req, res) => {
    res.render('index.html')
    /*
    req
        query           问号参数
        params          别名参数
        body            表单参数
            cnpm i body-parser
                const bodyParser = require('body-parser')
                app.use(bodyParser.json())
                app.use(bodyParser.)
        ip              客户端IP
        hostname        服务器name

    res
        end
        send
        sendFile
        sendStatus
        status
        download
        cookie
        clearCookie
        render  ejs
            app.set('view engine','ejs')
            app.set('views','/view')
        redirect    back
        json

----------静态托管
app.use(express.static('/))
-----





    */
})
app.listen(80)
console.log('服务器 localhost 端口 80');